﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="http://netdna.bootstrapcdn.com/bootstrap/2.3.2/css/bootstrap.min.css" rel="stylesheet">
<title>lecture2a</title>
<style>
    div { margin-top: 30px; padding: 8px; border: solid 1px #ddd; }
</style>
</head>
<body>

<div class="container">
    <h1>JSTL Test2</h1>

    <div>
        <c:if test="${ user1.name == '홍길동' }">
            홍길동이 맞다.
        </c:if>
        <c:if test="${ user1.name != '전우치' }">
            전우치는 아니다.
        </c:if>
    </div>

    <div>
        <c:if test="${ user1.age < 10 }">
            ${ user1.name }은 어린이
        </c:if>
        <c:if test="${ 10 <= user1.age && user1.age < 20 }">
            ${ user1.name }은 청소년
        </c:if>
        <c:if test="${ 20 <= user1.age }">
            ${ user1.name }은 성인
        </c:if>
    </div>

    <div>
        <c:choose>
            <c:when test="${ user1.age < 10 }">
                ${ user1.name }은 어린이
            </c:when>
            <c:when test="${ user1.age < 20 }">
                ${ user1.name }은 청소년
            </c:when>
            <c:otherwise>
                ${ user1.name }은 성인
            </c:otherwise>
        </c:choose>
    </div>

    <div>
        <a href="/lecture2a/index.jsp" class="btn">index.jsp</a>
    </div>

</div>

</body>
</html>